package cn.itcast.bos.service.base.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.domain.Specification;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import cn.itcast.bos.dao.base.SubAreaRepository;
import cn.itcast.bos.domain.base.SubArea;
import cn.itcast.bos.service.base.SubAreaServcie;
@Service
@Transactional
public class SubAreaServiceImpl implements SubAreaServcie{
	@Autowired
	private SubAreaRepository subAreaRepository;
	//添加功能
	@Override
	public void save(SubArea subArea) {
		subAreaRepository.save(subArea);
	}
	//分区 信息上传  导入
	@Override
	public void saveBatch(List<SubArea> list) {
		subAreaRepository.save(list);
		
	}
	//查询到所有  分区信息   用于导出
	@Override
	public List<SubArea> findAll() {
		
		return subAreaRepository.findAll();
	}
	/**
	 * 分页条件查询
	 */
	@Override
	public Page<SubArea> pageQuery(Specification specification, Pageable pageable) {
		
		return subAreaRepository.findAll(specification,pageable);
	}

}
